<?php

if(!empty($_GET['id'])){
$id=$_GET['id'];
$row=delete('news','id='.$id);
if($row>0){
	echo '<script>alert ("删除成功");location="index.php?admin=1&c=news&a=list";</script>';
	};

};

if(!empty($_POST)){
	$id=($_POST['id']);
$where=' ';
foreach($id as $key => $value){
	$where.='id='.$value.' or ';
	};
	$where=substr($where,0,-4);
$sum=delete('news',$where);
if($sum>0){
	echo '<script>alert ("删除成功");location="index.php?admin=1&c=news&a=list";</script>';
	};
}else{
	echo '<script>alert ("请选择要删除的记录");location="index.php?admin=1&c=news&a=list";</script>';
	};

?>